{template 'common/header'}
<ul class="nav nav-tabs">
    {if $user} <li {if $operation=='set' }class="active" {/if}><a href="{php echo $this->createWebUrl('business', array('op' => 'dp','operation' => 'set'))}">个人设置</a></li>{/if}
    <li {if $operation=='list' }class="active" {/if}><a href="{php echo $this->createWebUrl('business', array('op' => 'dp','operation' => 'list'))}">店铺列表</a></li>
    <li {if $operation=='add' }class="active" {/if}><a href="{php echo $this->createWebUrl('business', array('op' => 'dp','operation' => 'add'))}">添加店铺</a></li>
</ul>

    <div class="panel panel-default">
        <div class="panel-body table-responsive">
            <table class="table table-hover" ng-controller="advAPI" style="width:100%;" cellspacing="0" cellpadding="0">
                <thead class="navbar-inner">
                    <tr>
                        <th width="100">商家名</th>
                        <th width="100">类目</th>
                        <th width="80">营业时间</th>
                        <th width="60">联系人</th>
                        <th width="110">电话</th>
                        <th width="200">地址</th>
                        <th width="300" style="text-align:right">操作</th>
                    </tr>
                </thead>
                <tbody>
                    {loop $list $item}
                    <tr>
                        <td>{$item['sjname']}</td>
                        <td>{$item['parent']}->{$item['child']}</td>
                        <td>{$item['businesstime']}</td>
                        <td>{$item['contactname']}</td>
                        <td>{$item['mobile']}</td>
                        <td>{$item['province']} {$item['city']} {$item['district']} {$item['address']}</td>
                        <td style="text-align:right">
                        	<a href="{php echo $this->createWebUrl('business',array('op' => 'goods','operation' => 'list','dpid' => $item['id']))}" class="btn btn-default" title="编辑">商品管理</a>
                            <a href="{php echo $this->createWebUrl('business',array('op' => 'rank','operation' => 'list','dpid' => $item['id']))}" class="btn btn-default" title="编辑">评价管理</a>
                            <a href="{php echo $this->createWebUrl('business',array('op' => 'dp','operation' => 'add','id' => $item['id']))}" class="btn btn-default" title="编辑">编辑</a>
                            <a class="btn btn-default" onclick="del({$item['id']})" title="删除">删除</a>
                        </td>
                    </tr>
                    {/loop}
                </tbody>
            </table>
        </div>
    </div>
    {$pager}

<script type="text/javascript">
function del(id) {
    var id = id;
    var url = "{php echo $this->createWebUrl('business',array('op' => 'del'))}";
    $.post(url, {
            id: id
        },
        function(msg) {
            if (msg.status == 1) {
                setTimeout(function() {
                    window.location.reload();
                }, 100);
            };

        },
        'json');
}
</script>
{template 'common/footer'}
